#include "Greedy.h"

void test1() {
    Greedy greedy;
    std::vector<int> coins = {1,5,10,20,50,100};
    int amt = 131;
    int res = greedy.CoinsChangeGreedy(coins,amt);
    std::cout << "贪心算法求解组成金额 = " << amt << "所需的最少硬币数量是：" << res << std::endl;
}

void test2() {
    Greedy greedy;
    std::vector<double> wgt = {10,20,30,40,50};
    std::vector<double> val = {50,120,150,210,240};
    double cap = 50.0;
    double res = greedy.fractionalKnapsack(wgt,val,cap);
    std::cout << "贪心算法求解分数背包问题得到的最大价值是: " <<  res << std::endl;
}

void test3() {
    Greedy greedy;
    std::vector<int> ht = {3,8,5,2,7,7,3};
    int res = greedy.maxCapacity(ht);
    std::cout << "贪心算法求解最大容量问题得到的最大容量是: " <<  res << std::endl;
}

void test4() {
    Greedy greedy;
    int n = 10;
    int res = greedy.maxProductCutting(n);
    std::cout << "贪心算法求解最大切分乘积问题得到的最大乘积是: " <<  res << std::endl;
}

int main() {
    std::cout << "贪心算法" << std::endl;
    test4();
    return 0;
}